package com.itheima.clientAndService01;

public class MainClass {
    public static void main(String[] args) {
        int num = 10;
        int sum = getSum(num);
        System.out.println(sum);
    }

    private static int getSum(int num) {
        if (num == 1){
            return 1;
        }
        num += getSum(num - 1);
        return num;
    }
}
